/*
 * @Description:
 * @Author: your name
 * @version:
 * @Date: 2024-06-24 09:19:39
 * @LastEditors: your name
 * @LastEditTime: 2024-06-24 09:19:41
 */
import axios from "axios"
import { message } from "ant-design-vue"

const request = axios.create({
  baseURL: "http://127.0.0.1:8090/api/v1",
  timeout: 10000,
})

request.interceptors.response.use(
  (response) => {
    return response.data
  },
  (error) => {
    message.error(error.response?.data?.message || "请求失败")
    return Promise.reject(error)
  }
)

export default request
